package springboot.springboot06_ssmp.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springboot.common_utils.R;
import springboot.springboot06_ssmp.entity.Menu;
import springboot.springboot06_ssmp.service.IMenuService;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author daiqiang
 * @since 2024-06-20
 */
@Slf4j
@CrossOrigin  //允许跨域
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private IMenuService menuService;
    @GetMapping
    public R<List<Menu>> getAllMenu() {
        List<Menu> resultList = menuService.getAllMenu();
        return R.success(resultList);
    }

}
